<template>
    <el-button @click="test" type="primary">test</el-button>
</template>
<script setup>

import { ref  } from 'vue'
import { onMounted  } from 'vue'

let userId=ref('')


onMounted(() => {
    userId=localStorage.getItem('id')
})

function test(){
    alert(userId)
}

</script>